package com.ruoyi.common.core.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 验证码类型
 *
 * @author Lion Li
 */
public enum OrderProcessFlag {
    //订单伊始状态
    Begin(0, "begin"),
    //菜鸟流程
    CaiNiao(1, "cainiao"),
    //线下发货流程
    Offline(2, "offline"),
    //截单流程
    CutOff(3, "cutoff"),
    //测评流程
    Evaluation(4, "evaluation"),
    //作废流程
    Invalid(5, "invalid"),
    //自发货流程
    MySelf(6, "myself"),
    //问题件流程
    Problem(7, "problem"),
    //Erp外部订单
    Out(8, "out"),
    //待处理
    Pending(9, "pending"),
    //客户退单，导致货物发走
    Error(10, "error"),
    //店铺授权失效，订单信息同步异常
    Issue(11, "issue"),
    // 公司测评
    CompanyEva(12, "companyEva");

    private final Integer code;
    private final String info;

    OrderProcessFlag(Integer code, String info) {
        this.code = code;
        this.info = info;
    }

    public Integer getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }


    public static Map<String,Object> getOrderStatusCollocationMap() {
        Map<String,Object> erpOrderStatus = new HashMap<>();
        //前置为系统内订单状态 后置为Ae速卖通当前订单状态

        //未付款 - 未付款
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-PLACE_ORDER_SUCCESS","100");
        //未付款 - 风控
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-RISK_CONTROL","102");
        //未付款 - 待发货
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-WAIT_SELLER_SEND_GOODS","101");
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-WAIT_BUYER_ACCEPT_GOODS","103");
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-FINISH","104");
        erpOrderStatus.put("PLACE_ORDER_SUCCESS-PROBLEM","105");

        //风控
        erpOrderStatus.put("RISK_CONTROL-RISK_CONTROL","100");
        erpOrderStatus.put("RISK_CONTROL-WAIT_SELLER_SEND_GOODS","101");
        erpOrderStatus.put("RISK_CONTROL-FINISH","104");
        erpOrderStatus.put("RISK_CONTROL-WAIT_BUYER_ACCEPT_GOODS","103");
        erpOrderStatus.put("RISK_CONTROL-PROBLEM","105");

        //待发货
        erpOrderStatus.put("WAIT_SELLER_SEND_GOODS-WAIT_SELLER_SEND_GOODS","100");
        erpOrderStatus.put("WAIT_SELLER_SEND_GOODS-WAIT_BUYER_ACCEPT_GOODS","103");
        erpOrderStatus.put("WAIT_SELLER_SEND_GOODS-FINISH","104");
        erpOrderStatus.put("WAIT_SELLER_SEND_GOODS-PROBLEM","105");

        //已发货
        erpOrderStatus.put("WAIT_BUYER_ACCEPT_GOODS-WAIT_BUYER_ACCEPT_GOODS","100");
        erpOrderStatus.put("WAIT_BUYER_ACCEPT_GOODS-FINISH","112");
        erpOrderStatus.put("WAIT_BUYER_ACCEPT_GOODS-PROBLEM","105");

        //订单关闭
        erpOrderStatus.put("FINISH-FINISH","100");
        erpOrderStatus.put("FINISH-PROBLEM","105");

        //问题件
        erpOrderStatus.put("PROBLEM-PLACE_ORDER_SUCCESS","106");
        erpOrderStatus.put("PROBLEM-RISK_CONTROL","107");
        erpOrderStatus.put("PROBLEM-WAIT_SELLER_SEND_GOODS","108");
        erpOrderStatus.put("PROBLEM-WAIT_BUYER_ACCEPT_GOODS","109");
        erpOrderStatus.put("PROBLEM-FINISH","110");
        erpOrderStatus.put("PROBLEM-PROBLEM","111");

        return erpOrderStatus;
    }

}
